/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.model;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;


@Entity
@Table(name = "tb_const_tp_cmco_ogm")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TbConstTpCmcoOgm.findAll", query = "SELECT t FROM TbConstTpCmcoOgm t"),
    @NamedQuery(name = "TbConstTpCmcoOgm.findByCdTpCmco", query = "SELECT t FROM TbConstTpCmcoOgm t WHERE t.cdTpCmco = :cdTpCmco"),
    @NamedQuery(name = "TbConstTpCmcoOgm.findByDcrTpCmco", query = "SELECT t FROM TbConstTpCmcoOgm t WHERE t.dcrTpCmco = :dcrTpCmco")})
public class TbConstTpCmcoOgm implements Serializable {
    @OneToMany(mappedBy = "cdTpCmco")
    private Collection<TbAjztCaoOprSeldCmcoOgmx> tbAjztCaoOprSeldCmcoOgmxCollection;
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cd_tp_cmco")
    private Integer cdTpCmco;
    @Column(name = "dcr_tp_cmco")
    private String dcrTpCmco;

    public TbConstTpCmcoOgm() {
    }

    public TbConstTpCmcoOgm(Integer cdTpCmco) {
        this.cdTpCmco = cdTpCmco;
    }

    public Integer getCdTpCmco() {
        return cdTpCmco;
    }

    public void setCdTpCmco(Integer cdTpCmco) {
        this.cdTpCmco = cdTpCmco;
    }

    public String getDcrTpCmco() {
        return dcrTpCmco;
    }

    public void setDcrTpCmco(String dcrTpCmco) {
        this.dcrTpCmco = dcrTpCmco;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cdTpCmco != null ? cdTpCmco.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {

        if (!(object instanceof TbConstTpCmcoOgm)) {
            return false;
        }
        TbConstTpCmcoOgm other = (TbConstTpCmcoOgm) object;
        if ((this.cdTpCmco == null && other.cdTpCmco != null) || (this.cdTpCmco != null && !this.cdTpCmco.equals(other.cdTpCmco))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "db.pojo.TbConstTpCmcoOgm[ cdTpCmco=" + cdTpCmco + " ]";
    }

    @XmlTransient
    public Collection<TbAjztCaoOprSeldCmcoOgmx> getTbAjztCaoOprSeldCmcoOgmxCollection() {
        return tbAjztCaoOprSeldCmcoOgmxCollection;
    }

    public void setTbAjztCaoOprSeldCmcoOgmxCollection(Collection<TbAjztCaoOprSeldCmcoOgmx> tbAjztCaoOprSeldCmcoOgmxCollection) {
        this.tbAjztCaoOprSeldCmcoOgmxCollection = tbAjztCaoOprSeldCmcoOgmxCollection;
    }
    
}
